function validateEmail(email) {
    // http://stackoverflow.com/a/46181/11236
    var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
    return re.test(email);
}

function IsNumeric(input)
{
    return (input - 0) === input && (input + '').replace(/^\s+|\s+$/g, "").length > 0;
}

_REGISTER = {
    validateSt2: function()
    {
        var err = "";
        !$(".is-required").each(function(index, value) {
            err = "Please fill all required fields";
        });

        if (!err)
            return true;

        alert(err);
        return false;

    },
    validateSt1: function()
    {
        var err = "";

        if (!validateEmail($("#email").val()))
            err += "Please enter a valid email address\n";

        if (!err)
            return true;

        alert(err);
        return false;
    },
    resellerRegister: function() {
        var err = "";

        if (!validateEmail($("#email").val()))
            err += "Please enter a valid email address\n";

        if (!err)
            return true;

        alert(err);
        return false;
    }
};
